﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
using Deliveryroomstatusbulletin.EntityData;

namespace DeliveryRoomStatusBulletin
{
    /// <summary>
    /// RemindWindow.xaml 的交互逻辑
    /// </summary>
    public partial class RemindWindow : Window
    {
        int i = 0;
        public RemindWindow()
        {
            InitializeComponent();
        }
        DispatcherTimer dt;
        public RemindWindow(DeliveryroomstatusbulletinData model)
        {
            InitializeComponent();

            dt = new DispatcherTimer();
            dt.Interval = TimeSpan.FromSeconds(10);
            dt.Tick += new EventHandler(dt_Tick);//调用函数
            dt.Start();
            DataBind(model);
        }

        private void DataBind(DeliveryroomstatusbulletinData model) 
        {
            labl.Content = "请"+model.Bedid+" 床"+ model.Name+" 家属准备";
            tb_Goods.Text = model.Goods;
        }

        private void dt_Tick(object sender, EventArgs e)
        {
            this.Close();
            dt.Stop();
        }
    }
}
